package com.pisolution.scheduler.runtime.master.scheduler;

import com.pisolution.scheduler.datasource.alert.AlertService;
import com.pisolution.scheduler.datasource.alert.AlertServiceFactory;
import com.pisolution.scheduler.datasource.instance.TaskInstance;
import com.pisolution.scheduler.datasource.instance.WorkflowInstance;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * 告警管理器.
 *
 * @author sora
 * @version 0.1.0
 */
public final class AlertManager {
    private static final Logger LOGGER = LoggerFactory.getLogger(AlertManager.class);

    // -------------------------------------------------------------------------------------------------

    /** 用于报告运行中的错误信息. */
    private final AlertService service;

    // -------------------------------------------------------------------------------------------------
    //  初始化
    // -------------------------------------------------------------------------------------------------

    public AlertManager() {
        this.service = AlertServiceFactory.getAlertService();
    }

    // -------------------------------------------------------------------------------------------------
    //  发送告警信息
    // -------------------------------------------------------------------------------------------------

    public void sendWorkflowInstanceTimeoutAlert(final WorkflowInstance instance) {
        // TODO: 完成此处逻辑.
    }

    public void sendWorkerServerFaultTolerantAlert(final WorkflowInstance instance, final List<TaskInstance> tasks) {
        // TODO: 完成此处逻辑.
    }

    public void sendWorkflowInstanceAlert(final WorkflowInstance instance, final List<TaskInstance> tasks) {
        // TODO: 完成此处逻辑.
    }
}
